package com.itheima.demo01.Map;

import java.util.HashMap;
import java.util.Map;

public class Demo01Map {
    public static void main(String[] args) {
        show04();
    }

    public static void show01() {
        Map<String, String> map = new HashMap<>();
        String v1 = map.put("李晨", "范冰冰1");
        System.out.println("v1:" + v1);
        String v2 = map.put("李晨", "范冰冰2");
        System.out.println("v2:" + v2);
        System.out.println(map);
        map.put("冷锋", "龙小云");
        map.put("杨过", "小龙女");
        map.put("尹志平", "小龙女");
        System.out.println(map);
    }

    public static void show02() {
        Map<String, Integer> map = new HashMap<>();
        map.put("赵丽颖", 168);
        map.put("杨颖", 165);
        map.put("林志玲", 178);
        System.out.println(map);
        map.remove("林志玲");
        System.out.println(map);
    }

    public static void show03() {
        Map<String, Integer> map = new HashMap<>();
        map.put("赵丽颖", 168);
        map.put("杨颖", 165);
        map.put("林志玲", 178);
        Integer v1 = map.get("杨颖");
        System.out.println(v1);
    }
    public static void show04() {
        Map<String, Integer> map = new HashMap<>();
        map.put("赵丽颖", 168);
        map.put("杨颖", 165);
        map.put("林志玲", 178);
        boolean v1 = map.containsKey("杨颖");
        System.out.println(v1);
    }
}

